import 'package:flutter/material.dart';

class LearnBaseRouterCPage extends StatefulWidget {
  const LearnBaseRouterCPage({super.key});
  @override
  State<LearnBaseRouterCPage> createState() => _LearnBaseRouterCPageState();
}

class _LearnBaseRouterCPageState extends State<LearnBaseRouterCPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: const Text("C页面"),
        ),
        body:Center(
          child:Column(
            children: [
              TextButton(onPressed:()=>{
                Navigator.popUntil(context, ModalRoute.withName('/'))
              }, child: const Text("返回root页面")),
              TextButton(onPressed:()=>{
                Navigator.popUntil(context, ModalRoute.withName('/A'))
              }, child: const Text("返回A页面"))
            ],
          ),
        )
      // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
